<template>
  <div>
    <div class="head">
      <input class="search" placeholder="搜索店内商品" v-model="value" @keyup.enter="search()">
      <span class="shopname">{{name}}</span>
    </div>

    <div class="content">
      <div class="shop">商品</div>
      <div class="comment">评价</div>
      <div class="daohang">
        <div class="detail">
          <div v-for="(val,index) in goodlist" :key="index" class="shopdetail">
            <img :src="val.img">
            <span class="name">
              {{val.title}}
              <br>
              <span class="num">月销量：{{val.num}}</span>
            </span>

            <div v-show="val.discount>0" class="originprice">
              <div class="discount">{{val.discount?val.discount+"折":""}}</div>
              {{val.discount?"限一次优惠":""}}
            </div>

            <div class="price">
              ￥{{val.price}}
              <span class="orprice">{{val.originPrice?"￥"+val.originPrice:""}}</span>
            </div>

            <div class="addorjian">
              <div class="add" @click="add(val)">+</div>
              <div class="addnum">{{val.buynum}}</div>
              <div class="jian" @click="jian(val.kind,val.id)">-</div>
            </div>

            <br>
          </div>
        </div>

        <div v-for="(val,key) in a" :key="key" @click="getGood(val.kind)">
          <div class="left">
            {{val.name}}
            <div class="goodnum" v-show="val.num>0">{{val.num?val.num:""}}</div>
          </div>
          <span>{{val.originPrice?"￥"+val.originPrice:""}}</span>

        </div>
      </div>
    </div>

    <div class="foot">
      <span class="sumnum">{{sumnum}}</span>
      <img src="../public/public/img/吃了吗？.png">
      <span class="sumprice">{{"￥"+sumprice}}</span>
      <div class="getorder" @click="getorder">去结算</div>
    </div>
  </div>
</template>

<script>



</script>
<style lang="">
  * {
    padding: 0;
    margin: 0;
  }
  .sumprice {
    position: absolute;
    top: 10px;
    left: 80px;
    font-size: 20px;
    font-weight: bold;
    color: white;
  }
  .getorder {
    position: absolute;
    left: 314px;
    background-color: green;
    width: 100px;
    height: 100px;
    text-align: center;
    font-size: 20px;
    color: white;
    font-weight: bolder;
    line-height: 75px;

    /* overflow:hidden */
  }
  .content {
    width: 100%;
    /* margin-bottom: 20px; */
  }
  .sumnum {
    position: absolute;
    margin-left: 42px;
    width: 20px;
    height: 20px;
    border-radius: 10px;
    background-color: red;
    text-align: center;
    z-index: 1;
    color: white;
    font-weight: bold;
    vertical-align: middle;
  }
  .addnum {
    width: 20px;
    height: 20px;
    float: right;
    color: black;
    text-align: center;
    vertical-align: middle;
    margin-top: -17px;
    margin-left: 8px;
  }
  .addorjian {
    margin-right: 30px;
  }
  .goodnum {
    color: white;
    font-weight: bold;
    display: inline-block;
    width: 20px;
    height: 20px;
    border-radius: 10px;
    background-color: red;
    text-align: center;
    line-height: 20px;
  }
  .shopname {
    margin-left: 20px;
    margin-top: 10px;
    font-size: 15px;
    color: white;
    display: block;
  }
  .search {
    margin-top: 20px;
    margin-left: 10px;
  }
  .orprice {
    text-decoration: line-through;
    color: gray;
    margin-left: 5px;
  }
  .add {
    width: 20px;
    height: 20px;
    border-radius: 10px;
    float: right;
    background-color: cornflowerblue;
    color: white;
    text-align: center;
    vertical-align: middle;
    /* display: inline-block; */
    margin-top: -17px;
    margin-left: 8px;
    font-weight: bold;
  }
  .jian {
    width: 20px;
    height: 20px;
    border-radius: 10px;
    float: right;
    background-color: cornflowerblue;
    color: white;
    text-align: center;
    vertical-align: middle;
    display: inline-block;
    margin-top: -17px;
    font-weight: bold;
  }
  .originprice {
    display: inline-block;
    color: red;
    width: auto;
    height: 16px;
    border: 1px red solid;
    border-radius: 3px;
    margin-left: 0px;
    text-align: center;
    vertical-align: middle;
    padding-right: 2px;
    margin-top: -10px;
  }

  .discount {
    display: inline-block;
    margin-right: 5px;
    color: white;
    background-color: red;
  }
  .head {
    width: 100%;
    height: 100px;
    background-color: olivedrab;
  }
  .shop {
    width: 49%;
    height: 30px;
    display: inline-block;
    line-height: 30px;
    font-weight: bolder;
    border-bottom: 1px solid olivedrab;
  }
  .shop:hover {
    color: olivedrab;
  }
  .comment {
    width: 50%;
    height: 30px;
    display: inline-block;
    line-height: 30px;
    font-weight: bolder;
    border-bottom: 1px solid olivedrab;
  }
  .comment:hover {
    color: olivedrab;
  }
  .left {
    width: 20%;
    height: 30px;
    border-top: 0px;
    line-height: 30px;
    text-align: center;
    color: gray;
    background-color: #f8f8f8;
  }
  .daohang {
    width: 100%;
  }
  .detail {
    width: 76%;
    height: 200px;
    margin-top: 20px;
    position: absolute;
    right: 0;
  }
  .shopdetail img {
    width: 70px;
    height: 60px;
  }
  .name {
    position: absolute;
    line-height: 20px;
    font-weight: bold;
  }
  .price {
    color: red;
    margin-left: 70px;
    /* float: left; */
    /* display: inline-block; */
  }

  .num {
    font-weight: normal;
    color: gray;
  }
  .foot img {
    width: 90px;
    height: 70px;
    position: fixed;
    bottom: 10px;
    left: 10px;
  }
  .foot {
    height: 80px;
    width: 100%;
    position: absolute;
    bottom: 0px;
    background-color: olivedrab;
    border-radius: 50px;
    /* position:relative; */
    overflow: hidden;
  }
</style>
